<?php
session_start();
include_once("item.php");
include_once("Cart.php");
if (isset($_SESSION["login"]) == FALSE) {
    $_SESSION["login"] = false;
}
?>

<html class="no-js">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>BabyShop</title>
        <link href="css/style.css" rel="stylesheet" type="text/css" />
        <link href="css/nav-menu.css" rel="stylesheet" type="text/css" />
        <script src="js/js.js" type="text/javascript"></script>
        <script src="./js/scrollback.js" type="text/javascript"></script>
        <script src="js/jquery-1.7.2.min.js" type="text/javascript" ></script>
        <script src="js/jquery.lightbox-0.5.js" type="text/javascript" ></script> 
        <script src="js/coin-slider.min.js" type="text/javascript" ></script>
        <script src="./js/modernizr.custom.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $('#gallery a').lightBox();
            });
        </script>
    </head>

    <body>
        <div id="main">
            <div id="main-wrapper">
                <header id="header">
                    <div class="header-content">
                        <div class="top-menu">
                            <form action="login.php" method="POST" onsubmit="return CheckInput();">
                                <?php
                                if (isset($_REQUEST["logout"]) == true) {
                                    session_destroy();
                                    $_SESSION["login"] = false;
                                    $_SESSION["customername"] = null;
                                    header("Location: index.php");
                                }

                                if ($_SESSION["login"] == false) {
                                    ?> 
                                    <ul class="top-menu-info">
                                        <li><input name="txtusername" id="txtUS" class="txtlogin" type="text" title="Tài khoản" placeholder="Tên tài khoản"/></li>
                                        <li><input name="txtpassword" id="txtPS" class="txtlogin" type="password" title="Mật khẩu" placeholder="Mật khẩu"/></li>
                                        <li><input id="btndangnhap" type="submit" value="Đăng nhập" title="Đăng nhập"/></li>
                                        <li ><a href="register.php" title="Đăng ký" class="btn-login">Đăng ký</a></li>
                                    </ul>
                                    <?php
                                } else {
                                    ?>
                                    <ul class="top-menu-info">
                                        <li class="hello-user"><?php echo ("Xin  chào  " . $_SESSION["customername"]); ?></li>
                                        <li><a href="index.php?logout=1" class="btn-login" title="Đăng xuất">Đăng xuất</a></li>
                                        <li><a href="ViewCart.php" class=btn-login>Giỏ hàng</a></li>
                                    </ul>
                                <?php } ?></form>
                        </div>
                        <div class="header-left-block">
                            <div class="logo">
                                <a href="index.php"><img src="images/logo.png" width="200"></a>
                            </div>
                            <div class="policy">
                                <ul>
                                    <li class="policy-span">
                                        <a href="#"><i class="icon-save"></i>HÀNG HÓA<br>CHÍNH HÃNG</a>
                                    </li>
                                    <li class="policy-span">
                                        <a href="policy.php"><i class="icon-transport"></i>GIAO HÀNG<br>MIỄN PHÍ</a>
                                    </li>
                                    <li class="policy-span">
                                        <a href="policy.php#payment"><i class="icon-payment"></i>THANH TOÁN<br>LINH HOẠT</a>
                                    </li>
                                </ul>
                            </div>

                        </div>
                        <div class="header-right-block">

                            <div class="hotline">
                                <span class="hotline-number">
                                    <span class="hotline-title">Hỗ trợ và Tư vấn</span>
                                    <p>0936 290 292 - 01675 744 022</p>
                                </span>
                            </div>
                        </div>
                        <div class="nav-menu">
                            <div class="nav-menu-block">
                                <ul>
                                    <li><a href="index.php"><div class="dl-menuwrapper">
                                                <button>Trang chủ</button></a></li>
                                    <li>
                                        <div id="dl-menu" class="dl-menuwrapper">
                                            <button>Sản phẩm</button>
                                            <ul class="dl-menu">
                                                <li>
                                                    <a href="#">Theo loại</a>
                                                    <ul class="dl-submenu">
                                                        <li class="dl-back"><a href="#">back</a></li>
                                                        <li>
                                                            <a href="product.php?cat=1">Búp bê</a>
                                                        </li>
                                                        <li>
                                                            <a href="product.php?cat=2">Xếp hình</a>
                                                        </li>
                                                        <li>
                                                            <a href="product.php?cat=3">Xe đồ chơi</a>
                                                        </li>
                                                        <li>
                                                            <a href="product.php?cat=4">Đồ chơi thông minh</a>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li>
                                                    <a href="#">Theo nhà sản xuất</a>
                                                    <ul class="dl-submenu">
                                                        <li class="dl-back"><a href="#">back</a></li>
                                                        <li><a href="product.php?cat=5">LEGO</a></li>
                                                        <li><a href="product.php?cat=6">Chicco</a></li>
                                                        <li><a href="product.php?cat=7">Bright Starts</a></li>
                                                        <li><a href="product.php?cat=8">MGA Entertainment</a></li>
                                                        <li><a href="product.php?cat=9">Etic</a></li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </div>
                                    </li>
                                    <li><a href="contact.php"><div class="dl-menuwrapper">
                                                <button>Liên hệ</button></a></li>
                                    <li>
                                    <li class="nav-menu-span">
                                        <form>
                                            <input class="txt-search-content"type="text" name="searchcontent" placeholder="Tìm kiếm"/>
                                            <input class="btn-search" type="submit" name="btnsearch" value="Tìm"/>
                                        </form>
                                        
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </header>